#!/bin/bash
YAFS_BASEDIR=$(pwd);
source ${YAFS_BASEDIR}/parseoptions.sh
#ok now we're going to source the site config file
# source the config file, if there's a syntax error oh well
# definitions 
source ~/.ftpsync/${SITE}
source ${YAFS_BASEDIR}/checkconfig.sh #actually checks the files
source ${YAFS_BASEDIR}/definitions.sh
##U='update';
##C='commit';
##S='sync';
##MODE="";
if [ $MODE = 'commit' ] ; then
    source ${YAFS_BASEDIR}/hashlocalfiles.sh
    source ${YAFS_BASEDIR}/fetchremotehash.sh
    source ${YAFS_BASEDIR}/intersctions_and_unions.sh
    source ${YAFS_BASEDIR}/build_new_canonical.sh
fi
if [ $MODE = 'update' ] ; then
    source ${YAFS_BASEDIR}/hashlocalfiles.sh
    source ${YAFS_BASEDIR}/fetchremotehash.sh
    source ${YAFS_BASEDIR}/intersctions_and_unions.sh
    source ${YAFS_BASEDIR}/build_new_canonical.sh
fi
    
##touch
